<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>检测mysql关键词</title>
    <link rel="stylesheet" href="/html/bootstrap.min.css">
    <script src="/html/jquery.js"></script>
</head>
<style>
    .body{
        width:1200px;
        margin:0 auto;
    }
</style>
<body>
<div class="body">
    <textarea class="form-control aw_text"  rows="13" placeholder="这里写创建表sql"></textarea>
    <span class="text-danger">这里暂时只支持创建表的sql</span>
    <button type="button" class="btn btn-primary aw_sub">审核</button>
    <textarea class="form-control aw_info"  rows="10"  placeholder="这里会出现审核结果"></textarea>
</div>

</body>
<script>
    $('.aw_sub').on('click', function () {
        var sql = $('.aw_text').val();
        $.post("/check", {sql:sql}, function(res){
            // res = JSON.parse(res)
            console.log(res)
            var str = ""
            for (const key in res.data) {
                if (Object.hasOwnProperty.call(res.data, key)) {
                    const element = res.data[key];
                    str += element + "\r\n"
                }
            }
            $('.aw_info').val(str)
        })
    })
</script>
</html>